﻿using System;

namespace Taste
{
    /// <summary>
    /// Represents a trigger whose states can respond to.
    /// </summary>
    public interface ITrigger
    {
        /// <summary>
        /// Fires the trigger.
        /// </summary>
        /// <param name="arg">The optional argument.</param>
        void Fire(object arg = null);

        /// <summary>
        /// Returns true if the trigger can be fired in the current state.
        /// </summary>
        /// <param name="arg">The optional argument.</param>
        /// <returns>True if the trigger can be fired in the current state</returns>
        bool CanFire(object arg = null);

        /// <summary>
        /// Raises the CanFireChanged event.
        /// </summary>
        void RaiseCanFireChanged();

        /// <summary>
        /// Raised when the condition behind the CanFire method has changed.
        /// </summary>
        event EventHandler CanFireChanged;
    }
}
